package com.yboot.starter.shiro.core.impl;

import com.yboot.starter.common.core.userdetails.LoginUser;

import java.util.HashSet;
import java.util.Set;

/**
 * 功能描述
 *
 * @author yangcs
 * @date 2025/8/19
 */
public class DefaultShiroUserDetailServiceImpl implements ShiroUserDetailService {
    @Override
    public LoginUser loadByUsername(String username) {
        // 模拟用户
        Set<String> permissions = new HashSet<>();
        permissions.add("user:add");
        permissions.add("user:remove");

        Set<String> roles = new HashSet<>();
        roles.add("admin");
        roles.add("user");

        LoginUser loginUser = new LoginUser();
        loginUser.setUsername("admin");
        loginUser.setPassword("123456");
        loginUser.setId("1");
        loginUser.setRoleSet(roles);
        loginUser.setPermissionSet(permissions);
        return loginUser;
    }
}
